<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        #app {
            box-sizing: border-box;
            padding: 10px;
        }

        #app .title {
            line-height: 40px;
            text-align: center;
            font-size: 24px;
            color: rgb(253, 224, 0);
        }

        #app .manner {
            line-height: 25px;
            text-align: center;
            font-size: 14px;
            color: rgb(252, 218, 0);
            margin-bottom: 10px;
        }

        #app .list .item {
            display: flex;
            align-items: center;
            font-size: 18px;
            margin-bottom: 10px;
        }

        #app .list .item .left {
            width: 15%;
        }

        #app .list .item .left img {
            width: 100%;
            border-radius: 50%;
        }
        #app .list .item .middle {
            margin-left: 4%;
            width: 55%;
        }
        #app .list .item .middle .name{
            margin-bottom: 5px;
            color: rgb(137, 78, 6);
        }
        #app .list .item .middle .desc{
            font-size: 12px;
            color: rgb(253, 139, 0);
        }
        #app .list .item .right {
            flex: 1;
            line-height: 50%;
        }
        #app .list .item .right button{
            float: right;
            width: 70px;
            height: 30px;
            border-radius: 10px;
            border: 1px solid rgb(240, 132, 0);
            background-color: rgb(230, 171, 99);
        }
    </style>
</head>

<body>
    <div id="app">
        <div class="title">任务列表</div>
        <div class="manner">每完成一个任务,即可获得10MB-1GB流量哦!</div>
        <div class="list">
            <div class="item" v-for="(item,index) in tasklist" v-bind:key="index">
                <div class="left">
                    <img v-bind:src="item.pic" alt="">
                </div>
                <div class="middle">
                    <div class="name"> {{ item.name }} </div>
                    <div class="desc"> {{ item.desc }} </div>
                </div>
                <div class="right">
                    <button> {{ item.status == 1 ? '去完成' : (item.status == 2 ? '领取' : '已领取') }} </button>
                </div>
            </div>
        </div>
    </div>
</body>

</html>
<script src="./vue-2.5.21.js"></script>
<script>
    //实例化Vue对象
    var v = new Vue({
        el: '#app',      //Vue实例挂载的dom节点
        //data: function(){ return {} }
        data: {      //data 定义响应式数据
            tasklist: [
                { id: 1, pic: './images/5.jpg', name: '咪咕视频送流量', desc: '来咪咕视频,每月领500MB流量', status: 1 },
                { id: 2, pic: './images/5.jpg', name: '和彩云送福利', desc: '免费领100G空间+月月2GB', status: 2 },
                { id: 3, pic: './images/5.jpg', name: '最高40元套餐折扣券', desc: '参与抽奖,奖励10MB,经验值+10', status: 3 },
                { id: 4, pic: './images/5.jpg', name: '吃喝玩乐季，超级秒杀', desc: '进入隐藏二楼参与秒杀,奖励10MB,经验值+10', status: 3 },
            ]
        },
        computed: {}, //computed 定义计算属性
        watch: {}, //watch 定义数据监听
        methods: {}, //methods 定义方法(函数)
        filters: {}, //filters 定义过滤器
        directives: {}, //directives 定义自定义指令
        components: {}, //components 注册局部组件
    })
</script>